﻿using System;
using System.Text;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;


public partial class Mod_Report_frm_PrintPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string strReportUrl = "bmis_report/Rpt_StockIntoBod.raq";// this.Page.Request.Params["ReportUrl"].ToString();//报表文件

            //String[] gumentNames = strReportUrl.getArguments().getArgumentNames();
            string strBod_no = "INAF070203001";

            ClsReportDAL cls_report = new ClsReportDAL();
            DataSet dst = cls_report.GetReportSetInfo();

            if (dst != null && dst.Tables[0].Rows.Count > 0)
            {
                string strPath = dst.Tables[0].Rows[0][1].ToString().Trim();//应用服务路径
                int intWidth = Int32.Parse(dst.Tables[0].Rows[0][2].ToString().Trim());//报表宽度
                int intHeight = Int32.Parse(dst.Tables[0].Rows[0][3].ToString().Trim());//报表高度

                this.lblReport.Text = "<script language=javascript>var report = new runqianReport(\"" + intWidth + "\", \"" + intHeight + "\"); report.setServerURL(\"" + strPath + "\");</script>";

                StringBuilder strApp = new StringBuilder();
                strApp.Append("<script language=javascript>");
                strApp.Append("report.init();");
                strApp.Append("report.setFile('" + strReportUrl + "');");
                strApp.Append("report.putParam(arg1,'" + strBod_no + "');");
                strApp.Append("report.display();");
                strApp.Append("</script>");

                this.lblJs.Text = strApp.ToString();
            }
            else
            {
                this.lblJs.Text = "<script>alert('获取报表服务配置信息失败！');</script>";
            }
        }
        else
        {
            this.lblJs.Text = "";
        }
    }
}
